<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'user-form',
    'enableAjaxValidation' => false,
        ));
?>

<fieldset>
    <legend>Add User Form</legend>
    <div class="clearfix">
        <?php echo $form->labelEx($model, 'username'); ?>
        <div class="input">
            <?php echo $form->textField($model, 'username', array('class' => 'large', 'size' => 32, 'maxlength' => 32)); ?>
            <?php //echo $form->error($model, 'username'); ?>
        </div>
    </div>
    <div class="clearfix">
        <?php echo $form->labelEx($model, 'first_name'); ?>
        <div class="input">
            <?php echo $form->textField($model, 'first_name', array('size' => 50, 'maxlength' => 50)); ?>
            <?php //echo $form->error($model, 'first_name'); ?>
        </div>
    </div>
    <div class="clearfix">
        <?php echo $form->labelEx($model, 'last_name'); ?>
        <div class="input">
            <?php echo $form->textField($model, 'last_name', array('size' => 50, 'maxlength' => 50)); ?>
            <?php //echo $form->error($model, 'last_name'); ?>
        </div>
    </div>
    <div class="clearfix">
        <?php echo $form->labelEx($model, 'password'); ?>
        <div class="input">
            <?php echo $form->passwordField($model, 'password', array('size' => 60, 'maxlength' => 64)); ?>
            <?php //echo $form->error($model, 'password'); ?>
        </div>
    </div>
    <div class="clearfix">
        <?php echo $form->labelEx($model, 'email'); ?>
        <div class="input">
            <?php echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 128)); ?>
            <?php //echo $form->error($model, 'email'); ?>
        </div>
    </div>
    <div class="clearfix">
        <?php echo $form->labelEx($model, 'access_role'); ?>
        <div class="input">
            <?php echo $form->dropDownList($model, 'access_role', User::getAccessRoleList(), array()); ?>
            <?php //echo $form->error($model, 'access_role'); ?>
        </div>
    </div>
    <div class="clearfix">
        <?php echo $form->labelEx($model, 'group_id'); ?>
        <div class="input">
            <?php echo $form->dropDownList($model, 'group_id', CHtml::listData(Group::model()->findAll(), 'id', 'name'), array()); ?>
            <?php //echo $form->error($model, 'group_id'); ?>
        </div>
    </div>
</fieldset>

<?php echo $form->errorSummary($model); ?>

<div class="actions">
    <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn primary')); ?>
</div>

<?php $this->endWidget(); ?>